﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using JamesThew.Dashboard;

namespace JamesThew
{
    public partial class Default : System.Web.UI.MasterPage
    {
        public String Status = "";
        public PaymentDB pdb;
        public List<String[]> UserPayment;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserLogin"] != null && Session["UserID"] != null)
            {
                this.pdb = new PaymentDB();
                int UserID = JamesThew.Includes.Core.ParseInt(Session["UserID"].ToString());

                List<String[]> UserPayment = this.pdb.GetUserNotifications(UserID);
                int TimeLeft = JamesThew.Includes.Core.ParseInt(UserPayment[0][8]);

                if (TimeLeft <= 10)
                {
                    this.Status = "Your account will available until " + UserPayment[0][7] + ", you have " + UserPayment[0][8] + ". Please renew your account now!";
                }
            }
        }
    }
}